//
//  ViewController.m
//  UtilsDemo
//
//  Created by wulanzhou on 16/10/2.
//  Copyright © 2016年 wulanzhou. All rights reserved.
//

#import "ViewController.h"
#import "WXUtils.h"
#import "AliPayUtils.h"


@interface ViewController ()<UIScrollViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
   
   
    
    // Do any additional setup after loading the view, typically from a nib.
}

- (IBAction)shareClick:(id)sender {
    
    static AliPayUtils *pay=nil;
    pay=[[AliPayUtils alloc] init];
    [pay alixPayWithTitle:@"1天套餐" productDesc:@"日本1天套餐" money:@"0.01" orderNumber:@"20170130144303000000009" notifyURL:@"http://14.215.135.16:20000/notify/alipay" payCompleted:^(BOOL success, NSString *errCode, NSString *errMsg) {
        if (success) {
            NSLog(@"支付成功!!!");
        }else{
            NSLog(@"支付失败,errCode =%@ , errMsg =%@",errCode,errMsg);
        }
    }];
    
    
    /**
    NSString *sginStr=@"partner=\"2088811244911302\"&seller_id=\"18520865184@163.com\"&out_trade_no=\"SO1610093000000003\"&subject=\"中国大陆1天\"&total_fee=\"0.01\"&notify_url=\"http://14.215.135.16:51000/dev/merchandise/79/notify\"&service=\"mobile.securitypay.pay\"&payment_type=\"1\"&_input_charset=\"utf-8\"&it_b_pay=\"30m\"&show_url=\"m.alipay.com\"&sign=\"e%2BDVZjGsCzPJXNvZWw9CbP6XNJRaF3S5FRlUxMVzmZGEOh1ZqobMFXO6g0eNsSiZn%2BYsIfDd8QHQiOukanqOcEOIaRlQixXswmgXxzI0uENyUQE5zEULWI5pDeUPA5i75X3kNSCH0Q1%2BvNQpFUJ1YsyKEap%2B%2BtFu5hpxyrHwRp4%3D\"&sign_type=\"RSA\"";
    
    
    static AliPayUtils *pay=nil;
    pay=[[AliPayUtils alloc] init];
    [pay alixPayWithSign:sginStr payCompleted:^(BOOL success, NSString *errCode, NSString *errMsg) {
        if (success) {
            NSLog(@"支付成功!!!");
        }else{
            NSLog(@"支付失败,errCode =%@ , errMsg =%@",errCode,errMsg);
        }
    }];
    
    return;
    
    
    [[WXUtils shareInstance] payWithPerpayId:@"wx20161009092622a981a9a0790640398381" payCompleted:^(BOOL success, NSString *errCode, NSString *errMsg) {
        if (success) {
            NSLog(@"支付成功!!!");
        }else{
            NSLog(@"支付失败,errCode =%@ , errMsg =%@",errCode,errMsg);
        }
    }];
    
    return;
   
    
    
    
    [[WXUtils shareInstance] shareToFriendWithTitle:@"Lazar" message:@"i can do it." imageData:[NSData dataWithContentsOfFile:path] linkUrl:@"http://www.baidu.com" shareCompleted:^(BOOL success, NSString *errCode,NSString *errMsg) {
        if (success) {
            NSLog(@"分享成功!!!");
        }else{
            NSLog(@"分享失败!!!");
        }
    }];
     
     **/
    
    /**
   NSString *path=[[NSBundle mainBundle] pathForResource:@"share" ofType:@"jpg"];
    [[WXUtils shareInstance] shareToFriendGroupWithTitle:@"Lazar" message:@"i can do it." imageData:[NSData dataWithContentsOfFile:path] linkUrl:@"http://www.baidu.com"
     shareCompleted:^(BOOL success, NSString *errCode, NSString *errMsg) {
         if (success) {
             NSLog(@"分享成功!!!");
         }else{
             NSLog(@"分享失败!!!");
         }
     }];
     **/
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
